package com.sherllinhe.business.controller;

import com.sherllinhe.business.req.TrainQueryReq;
import com.sherllinhe.business.req.TrainSaveReq;
import com.sherllinhe.business.resp.TrainQueryResp;
import com.sherllinhe.business.service.TrainSeatService;
import com.sherllinhe.business.service.TrainService;
import com.sherllinhe.common.resp.CommonResp;
import com.sherllinhe.common.resp.PageResp;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 功能：
 * 作者：Sherllin He
 * 日期：2025/4/25 21:10
 */
@Slf4j
@RequestMapping("/train")
@RestController
public class TrainController {
    @Autowired
    private TrainService trainService;

    @GetMapping("/query-all")
    public CommonResp<List<TrainQueryResp>> register(){
        List<TrainQueryResp> list = trainService.queryAll();
        return new CommonResp<>(list);
    }
}
